TwainPRO 9 for ActiveX - User Guide > How To > End a TWAIN Session |
The TWAIN Session can be ended at any point. The actions to be taken depend on the state of the session.
OpenDSM or SelectSource has previously been called to open the Data Source Manager. Call CloseSession to close the Data Source Manager and terminate the TWAIN session.
OpenSession has previously been called to open the Data Source Manager and Data Source. Call CloseSession to close the Data Source and Data Source Manager and terminate the TWAIN session.
StartSession has previously been called to begin a scanning session. The TWAIN session can be terminated during the PreScan or PostScan event by setting the Cancel parameter. The TWAIN session can be cancelled during image transfer or during the PreScan or PostScan events by setting CancelPendingXfers. Either of these actions will cancel all pending image transfers, close the Data Source and the Data Source Manager, and terminate the TWAIN session.